
// wrapper 函数
module.exports = function (grunt) {

	grunt.initConfig({

		watch: {
			options: {
				livereload: true
			},
			jade: {
				files: ['view/**']
			},
			js: {
				files: ['models/*.js', 'schemas/*.js']
			}
		},

		nodemon: {
			dev: {
				options: {
					files: 'app.js',
					ignoredFiles: ['readme.md', 'node_modules/**', '.DS_Store'],
					watchedExtensions: ['js'],
					watchedFolders: ['app'],
					debug: true,
					delayTime: 1,
					env: {
						PORT: 2018
					},
					cwd: __dirname
				}
			}
		},

		concurrent: {
			tasks: ['nodemon', 'watch'],
			options: {
				logConcurrentOutput: true
			}
		}


	})

	// 加载包含 'uglify' 任务的插件
	grunt.loadNpmTasks('grunt-contrib-jshint')
	grunt.loadNpmTasks('grunt-contrib-watch')
	grunt.loadNpmTasks('grunt-nodemon')
	grunt.loadNpmTasks('grunt-concurrent') 	

	// 默认被执行的任务列表
	grunt.option('force', true)
	grunt.registerTask('default', ['concurrent'])

}




